import 'dart:ui';

extension ColorWithValues on Color {
  Color withValues({
    double? alpha, // 0.0 - 1.0
    int? red,
    int? green,
    int? blue,
  }) {
    return Color.fromARGB(
      (alpha != null ? (alpha * 255).clamp(0, 255).toInt() : this.alpha),
      red ?? this.red,
      green ?? this.green,
      blue ?? this.blue,
    );
  }
}
